package IT03;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateDemo {
    public static void main(String[] args) throws ParseException {
        //创建日期对象
        Date d = new Date();
        String s1 = DateUtils.dateToString(d, "yyyy年MM月dd日 HH:mm:ss");
        System.out.println(s1);
        System.out.println("-------");
        //创建字符串对象
        String s = "2012-3-14 11:12:05";
        Date d1 = DateUtils.stringToDate(s, "yyyy-MM-dd HH:mm:ss");
        System.out.println(d1);
    }
}
